import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int c = scanner.nextInt();
        int[][] connections = new int[n][2];
        int[][] queries = new int[m][2];
        for (int i = 0; i < n; i++) {
            connections[i][0] = scanner.nextInt();
            connections[i][1] = scanner.nextInt();
        }

        for (int i = 0; i < m; i++) {
            queries[i][0] = scanner.nextInt();
            queries[i][1] = scanner.nextInt();
        }

        Solution1 solution = new Solution1();
        solution.processQueries(c,connections,queries);
    }
}

class Solution1 {
    public int[] processQueries(int c, int[][] connections, int[][] queries) {
        int n = connections.length;
        int m = queries.length;

    }
}